//
//  CreateTableViewCell.m
//  Travel assistant
//
//  Created by 王京 on 16/3/9.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "CreateTableViewCell.h"

@implementation CreateTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self add];
    }
    
    return self;
}


- (void)add{
    
    self.titleLabel = [[UILabel alloc]init];
    
    self.titleLabel.frame = CGRectMake(10, 10, self.contentView.frame.size.width*0.5, 40);
    
    self.titleLabel.backgroundColor = [UIColor redColor];
    
    [self.contentView addSubview:self.titleLabel];
    
    self.countLabel = [[UILabel alloc]init];
    
    self.countLabel.frame = CGRectMake(CGRectGetMaxX(self.titleLabel.frame), 10, self.contentView.frame.size.width*0.5, 40);
    
    self.countLabel.backgroundColor = [UIColor greenColor];
    
    [self.contentView addSubview:self.countLabel];
    
}

- (void)layoutSubviews{
    
    [super layoutSubviews];
    
    self.titleLabel.frame = CGRectMake(10, 10, self.contentView.frame.size.width*0.5, 40);
    
    self.countLabel.frame = CGRectMake(CGRectGetMaxX(self.titleLabel.frame), 10, self.contentView.frame.size.width*0.4, 40);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
